# Maintainer:

pkgname=python-pyproject-metadata
pkgver=0.7.1
pkgrel=2
pkgdesc='PEP 621 metadata parsing'
arch=(any)
url='https://github.com/FFY00/python-pyproject-metadata'
license=(MIT)
depends=(python-packaging)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest)
source=(https://github.com/FFY00/python-pyproject-metadata/archive/$pkgver/$pkgname-$pkgver.tar.gz)
sha512sums=('a4cb97b6646b765016f047f8d3da388ab758dbf8acf5a8ee6ccb017c764a90c069e04effbef21f878be7f4b01a5090f24252372300ce7e3a0410a6eea5d98b66')

build() {
  cd $pkgname-$pkgver

  python -m build --wheel --no-isolation
}

check() {
  cd $pkgname-$pkgver

  pytest -v
}

package() {
  cd $pkgname-$pkgver

  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
